import { Http } from "../util/http";

export async function getArticleContext (id) {
    return await Http.get({
        url: `/article/getArticleContext/${id}`,
        token: null
    })
}
export async function addLike(id) {
    return await Http.post({
        url: `/article/like?articleId=${id}`,
        data: {
            articleId: id
        },
        token: null
    })
}
export async function addDislike(id) {
    return await Http.post({
        url: `/article/dislike?articleId=${id}`,
        data: {
            articleId: id
        },
        token: null
    })
}
export async function replyArticle(id, content) {
    return await Http.post({
        url: '/replyArticle',
        data: {
            articleId: id,
            content
        },
    })
}
export async function commentReply(id, content) {
    return await Http.post({
        url: '/CommentReply',
        data: {
            commentId: id,
            content
        },
    })
}
export async function replyTwoComment(id, content, toUid) {
    return await Http.post({
        url: '/ReplyTwoComment',
        data: {
            commentId: id,
            content,
            toUid
        },
    })
}
export async function lookArticle(id) {
    return await Http.post({
        url: `/article/look?articleId=${id}`,
        data: {
            articleId: id
        },
    })
}

export async function createArticle(data) {
    return await Http.post({
        url: '/article/createArticle',
        data
    })
}
